package com.rc.pojo.po.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class CommentTableDef extends TableDef {

    /**
     * 评论表 实体类。

 @author 27806
 @since 2024-06-15
     */
    public static final CommentTableDef COMMENT = new CommentTableDef();

    public final QueryColumn ID = new QueryColumn(this, "id");

    public final QueryColumn IMGS = new QueryColumn(this, "imgs");

    /**
     * 0农庄评价 1活动评价 2商品评价
     */
    public final QueryColumn TYPE = new QueryColumn(this, "type");

    public final QueryColumn CON_ID = new QueryColumn(this, "con_id");

    public final QueryColumn SCORE = new QueryColumn(this, "score");

    /**
     * 浏览量
     */
    public final QueryColumn VIEWS = new QueryColumn(this, "views");

    /**
     * 冗余字段 评论头像 用户更新信息后会刷新
     */
    public final QueryColumn AVATAR = new QueryColumn(this, "avatar");

    public final QueryColumn FARM_ID = new QueryColumn(this, "farm_id");

    /**
     * 对应表的id
     */
    public final QueryColumn ITEM_ID = new QueryColumn(this, "item_id");

    public final QueryColumn CONTENT = new QueryColumn(this, "content");

    /**
     * 冗余字段 评论用户名 用户更新信息后会刷新
     */
    public final QueryColumn NICK_NAME = new QueryColumn(this, "nick_name");

    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, IMGS, TYPE, CON_ID, SCORE, VIEWS, AVATAR, FARM_ID, ITEM_ID, CONTENT, NICK_NAME, CREATE_TIME, UPDATE_TIME};

    public CommentTableDef() {
        super("rc", "comment");
    }

    private CommentTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public CommentTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new CommentTableDef("rc", "comment", alias));
    }

}
